From a9b44cbae79e9c01cff07964a45e1c7efa7fb241 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Thu, 5 Dec 2024 19:20:36 -0800 Subject: cached rates --- src/routes/(app)/[username]/(profile)/+layout.server.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/routes/(app)/[username]/(profile)/+layout.server.ts') diff --git a/src/routes/(app)/[username]/(profile)/+layout.server.ts b/src/routes/(app)/[username]/(profile)/+layout.server.ts index 0ed3edb8..70e7ebdb 100644 --- a/src/routes/(app)/[username]/(profile)/+layout.server.ts +++ b/src/routes/(app)/[username]/(profile)/+layout.server.ts @@ -1,8 +1,10 @@ +import getRates from "$lib/rates"; import { get } from "$lib/utils"; export async function load({ depends, parent }) { depends("app:user"); + const rates = await getRates(); const { subject, user } = await parent(); const { follows, followers } = await get(`/${subject.pubkey}/count`); @@ -12,5 +14,5 @@ export async function load({ depends, parent }) { () => [], ); - return { follows, followers, followList }; + return { follows, followers, followList, rate: rates[subject.currency] }; } -- cgit v1.2.3